class MapPoi {
  MapPoi({
    this.latitude,
    this.longitude,
    this.name,
    this.address,
    this.city,
    this.photoUrls,
  });

  factory MapPoi.fromJson(Map<String, dynamic> json) {
    final coordinates = json['location'].toString().split(',');

    return MapPoi(
      latitude: double.parse(coordinates[1]),
      longitude: double.parse(coordinates[0]),
      name: json['name'].toString(),
      address: json['address'].toString(),
      city: json['cityname'].toString(),
      photoUrls: List<Map<String, dynamic>>.from(json['photos'])
          .map((p) => p['url'].toString())
          .toList(),
    );
  }

  double? latitude;
  double? longitude;
  String? name;
  String? address;
  String? city;
  List<String>? photoUrls;
}
